home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / SciAn / src / bop.h next >
C/C++ Source or Header  |  1994-08-01  |  1KB  |  76 lines

  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <sys/types.h>
  4. #include <sys/stat.h>
  5.  
  6. #ifndef TINY
  7. #define TINY    -HUGE
  8. #endif
  9.  
  10. #ifndef MIN
  11. #define MIN(a, b)    ((a) < (b) ? (a) : (b))
  12. #define MAX(a, b)    ((a) > (b) ? (a) : (b))
  13. #endif
  14. #define MATCH(a, b)    (strncmp((a), (b), strlen((b))) == 0)
  15.  
  16.  
  17. #define BOP_NEXT_POLY(a, b) \
  18.         (Bop_Polygon *)((char *)(b) + ((a)->bytes_per_poly))
  19.  
  20.  
  21. #define VERTS    1
  22. #define CONNS    2
  23. #define SCALARS    3
  24.  
  25. #define BOP_GEOM        1
  26. #define BOP_SCALAR        2
  27. #define BOP_CUR_POLY        3
  28.  
  29. #define BOP_MAX_VERTS        10
  30.  
  31. #define BOP_VPP            1
  32. #define    BOP_FTYPE        2
  33.  
  34. typedef struct {
  35.     unsigned long    index;
  36.     float        x, y, z, data;
  37.     } Bop_Vert;
  38.  
  39. typedef struct {
  40.     int        nvert;
  41.     Bop_Vert    vert[1];
  42.     } Bop_Polygon;
  43.  
  44. typedef struct {
  45.     int        nvert;
  46.     Bop_Vert    vert[2];
  47.     } Bop_Two_Polygon;
  48.  
  49. typedef struct {
  50.     unsigned int    type;
  51.     unsigned int    vert_per_poly;
  52.     unsigned int    bytes_per_poly;
  53.     unsigned long    nvert, nconn, npoly;
  54.     float        xmin, xmax;
  55.     float        ymin, ymax;
  56.     float        zmin, zmax;
  57.     float        smin, smax;
  58.     } Bop_Bounds;
  59.  
  60. typedef struct {
  61.     FILE        *fp;
  62.     int        modified;
  63.     struct    stat    status;
  64.     Bop_Bounds    info;
  65.     } Bop_Ptr;
  66.  
  67.  
  68. extern    void        bop_clear();
  69. extern    void        bop_close();
  70. extern    void        bop_update();
  71. extern    int        bop_write();
  72. extern    int        bop_set();
  73. extern    Bop_Ptr        *bop_open();
  74. extern    Bop_Ptr        *bop_open_lock();
  75. extern    Bop_Polygon    *bop_read();
  76.